<html><head><title>api.system.utils.Observer</title><link rel="stylesheet" type="text/css" href="../../../styles/main.css"><link rel="stylesheet" type="text/css" href="../../../styles/prettify.css"><script language=JavaScript src="../../../javascript/prettify.js"></script><script language=JavaScript src="../../../javascript/main.js"></script></head><body class="FramedContentPage" onLoad="{NDOnLoad();prettyPrint();}"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="api.system.utils.Observer"></a>api.<wbr>system.<wbr>utils.<wbr>Observer</h1><div class=CBody><p>Utility for observing defined properties/fields or functions which does return any value.</p><h4 class=CHeading>usage</h4><blockquote><pre class="prettyprint">var observer = new api.system.utils.Observer(&quot;getX&quot;, &quot;getY&quot;);
observer.setTarget(visualObjectInstance);
observer.isStashOld(); // returns true initially
observer.save();
observer.isStashOld(); // returns false as there isn't any change

visualObjectInstance.setX(10); // thus getX() would return 10

observer.isStashOld(); // returns true</pre></blockquote><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#api.system.utils.Observer" >api.<wbr>system.<wbr>utils.<wbr>Observer</a></td><td class=SDescription>Utility for observing defined properties/fields or functions which does return any value.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#api.system.utils.Observer.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#api.system.utils.Observer.setTarget" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">setTarget</a></td><td class=SDescription>sets target which should be observed for changes in the observed fields/functions</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#api.system.utils.Observer.getTarget" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">getTarget</a></td><td class=SDescription>returns the set observed target</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#api.system.utils.Observer.isStashOld" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">isStashOld</a></td><td class=SDescription>Checks if the observed target has changes in the fields/function which are traked</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#api.system.utils.Observer.stash" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">stash</a></td><td class=SDescription>Saves the current state of the observed target into memory by retrieving the value of the fields/functions</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#api.system.utils.Observer.clearStash" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">clearStash</a></td><td class=SDescription>Clears the saved stash</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="api.system.utils.Observer.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.system.utils.Observer.setTarget"></a>setTarget</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setTarget : function(</td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>sets target which should be observed for changes in the observed fields/functions</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.system.utils.Observer.getTarget"></a>getTarget</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>getTarget : function()</td></tr></table></blockquote><p>returns the set observed target</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.system.utils.Observer.isStashOld"></a>isStashOld</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>isStashOld : function()</td></tr></table></blockquote><p>Checks if the observed target has changes in the fields/function which are traked</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.system.utils.Observer.stash"></a>stash</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>stash : function()</td></tr></table></blockquote><p>Saves the current state of the observed target into memory by retrieving the value of the fields/functions</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="api.system.utils.Observer.clearStash"></a>clearStash</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>clearStash : function()</td></tr></table></blockquote><p>Clears the saved stash</p></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>setTarget : function(</td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>sets target which should be observed for changes in the observed fields/functions</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>getTarget : function()</td></tr></table></blockquote>returns the set observed target</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>isStashOld : function()</td></tr></table></blockquote>Checks if the observed target has changes in the fields/function which are traked</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>stash : function()</td></tr></table></blockquote>Saves the current state of the observed target into memory by retrieving the value of the fields/functions</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>clearStash : function()</td></tr></table></blockquote>Clears the saved stash</div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>